package com.arvato.minipro.bean.bean_dto.common;

import java.util.List;

/**
 * Describe：封住树的实体类 
 * @author smallking
 *
 *  2017年10月31日
 */
public class TreeBean {
	/**
	 * 节点ID
	 */
	private String id;
	/**
	 * 节点名称
	 */
	private String name;
	/**
	 * 父级节点的ID
	 */
	private String pid;
	/**
	 * 是否拥有子集
	 */
	@SuppressWarnings("unused")
	private boolean hasChildren;
	/**
	 * 图标
	 */
	private String icon;
	/**
	 * 链接
	 */
	private String link;
	/**
	 * 子集
	 */
	private List<TreeBean> children;
	/**
	 * 勾选
	 */
	private boolean checked;
	public TreeBean() {
		super();
	}
	
	public TreeBean(String id, String name, String pid) {
		super();
		this.id = id;
		this.name = name;
		this.pid = pid;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPid() {
		return pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}

	public boolean getHasChildren() {
		if(children != null && children.size() != 0) {
			return true;
		}else {
			return false;
		}
	}

	public void setHasChildren(boolean hasChildren) {
		this.hasChildren = hasChildren;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public List<TreeBean> getChildren() {
		return children;
	}

	public void setChildren(List<TreeBean> children) {
		this.children = children;
	}

	@Override
	public boolean equals(Object obj) {
		TreeBean treeBean = (TreeBean)obj;
		if(treeBean.getId().equals(this.getId())) {
			return true;
		}else {
			return false;
		}
	}

	public boolean getChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	
}
